package mx.vlabs.soapdroid.wsdl2java.ui;

import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.Window;

public class UIUtils {

	public static void centerWindow(Window w){
		Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
		Rectangle r = new Rectangle(dim);
		
		centerWindow(w, r);
	}
	
	public static void centerWindow(Window w, Rectangle r){
		w.setLocation((r.width/2-w.getSize().width/2)+r.x, (r.height/2-w.getSize().height/2)+r.y);
	}

}
